﻿//ICommissionManager.cs
//Copyright (c) 2013 StockSharp LLC, all rights reserved.
//This code module is part of StockSharp library.
//This code is licensed under the GNU GENERAL PUBLIC LICENSE Version 3.
//See the file License.txt for the license details.
//More info on: http://stocksharp.com

namespace StockSharp.Algo.Commissions
{
	using System.Collections.Generic;

	using Ecng.Collections;

	using StockSharp.BusinessEntities;

	/// <summary>
	/// Интерфейс менеджера расчета комиссии.
	/// </summary>
	public interface ICommissionManager
	{
		/// <summary>
		/// Суммарное значение комиссии.
		/// </summary>
		decimal Commission { get; }

		/// <summary>
		/// Суммарное значение комиссии, сгруппированное по типам.
		/// </summary>
		SynchronizedDictionary<CommissionTypes, decimal> CommissionPerTypes { get; }

		/// <summary>
		/// Тарифный план.
		/// </summary>
		IList<CommissionRule> Rules { get; }

		/// <summary>
		/// Обнулить <see cref="Commission"/>.
		/// </summary>
		void Reset();

		/// <summary>
		/// Рассчитать комиссию заявки.
		/// </summary>
		/// <param name="order">Заявка.</param>
		/// <returns>Комиссия заявки.</returns>
		decimal ProcessOrder(Order order);

		/// <summary>
		/// Рассчитать комиссию сделки.
		/// </summary>
		/// <param name="trade">Сделка.</param>
		/// <returns>Комиссия сделки.</returns>
		decimal ProcessMyTrade(MyTrade trade);
	}
}